package tw.miku.protocol.codec.user;

import java.nio.charset.CharacterCodingException;

import org.apache.mina.core.buffer.IoBuffer;

import tw.miku.constants.ProtocalConstants;
import tw.miku.protocol.codec.AbstractResponseMessagePack;
import tw.miku.util.BufferUtility;

public class GetReadyResponsePack extends AbstractResponseMessagePack
{

	public byte result;

	public GetReadyResponsePack()
	{
	}

	@Override
	public short getTag()
	{
		return ProtocalConstants.GET_READY;
	}

	@Override
	public IoBuffer encode() throws CharacterCodingException
	{
		IoBuffer buf = IoBuffer.allocate(100).setAutoExpand(true);

		buf.putUnsignedInt(5);
		buf.putShort(getTag());
		buf.putShort((short) 0);
		buf.put(result);
		buf.flip();
		return buf;
	}

}
